#ifndef FTTABWIDGET_H
#define FTTABWIDGET_H

#include "IncFreeTrack.h"
#include "freetrackwidget.h"

class FTPushButton;

class FTTabWidget : public FreeTrackWidget
{
    Q_OBJECT
public:
    explicit FTTabWidget(QWidget *parent = 0);

    void addTab( QWidget*, const QString& );
    void addTab( QWidget*, const QIcon&, const QSize& );
    void addTab( QWidget*, const QString&, const QIcon&, const QSize& );

    void addExtra( QWidget* );
    void setCurrentWidget( QWidget* );
    void showIndex();
    QWidget* currentWidget();

signals:
    void currentChanged();

public slots:

private slots:
    void selectTab();
    void indexTab();

private:
    QStackedWidget* panels;
    QWidget* index_tab;
    FTPushButton* back_button;

    QHash<FTPushButton*, QWidget*> bindings;
    QList<FTPushButton*> buttons;
    QList<QWidget*> extra_widgets;

    void appendTab( QWidget*, FTPushButton* );

    virtual QLayout* createHorizontal();
    virtual QLayout* createVertical();
};

#endif // FTTABWIDGET_H
